<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <form>
        <label for="stu_id">学号：</label>
        <input type="text" id="stu_id"><br>
        姓名：<input type="text" class="stu_name"><br>
        性别：<input type="text" class="stu_sex"><br>
        出生日期：<input type="text" class="stu_date"><br>
        爱好：<input type="text" class="stu_hobby"><br>
        头像：<input type="text" class="stu_head_img"><br>

    </form>
    <button class="btn_student_info">提交学生信息</button>
    <script>
        $('.btn_student_info').click((e)=>{
            e.preventDefault();
            $.ajax({
                method:'post',
                url:'http://localhost:3000/student_info',
                data:{
                    stu_id:$('#stu_id').val(),
                    stu_name:$('.stu_name').val(),
                    stu_sex:$('.stu_sex').val(),
                    stu_date:$('.stu_date').val(),
                    stu_hobby:$('.stu_hobby').val(),
                    stu_head_img:$('.stu_head_img').val()
                },
                success:(data)=>{
                    console.log(data);
                },
                error:(err)=>{
                    console.log(err);
                }
            })
        })
    </script>
    <script src="../../../../../../专业课程/jQuery第二周期/jquery/jquery-1.12.4.min.js"></script>
</body>
</html>